package RedisDay2;

import redis.clients.jedis.BinaryClient;
import redis.clients.jedis.Jedis;

import java.util.List;

public class RedisDemo1 {
    public static void main(String[] args) {
        //连接数据ku
        Jedis master = new Jedis("192.168.111.166", 7000);
        //测试
        master.select(1);
        //数据为list
//        master.lpush("name","小虎","小龙","小风");
//        master.lpush("age","16","17","15");
//        System.out.println(master.keys("*"));
        //在小虎后插入大虎
//        Long linsert = master.linsert("name", BinaryClient.LIST_POSITION.AFTER, "小龙", "大虎");
//        System.out.println(linsert);
        List<String> name = master.lrange("name", 0, -1);
        for (String s : name) {
            System.out.println(s);
        }
    }
}
